// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	2/21/2015 12:56:03 AM				
// -----------------------------

#ifndef _ShaderManager_h
#define _ShaderManager_h

#include "Common.h"
#include "CommandHandler.h"

namespace Flow
{

	class IGraphicsDevice;
	class IInputLayout;
	class IShader;
	class IMutex;

	class ShaderManager
	{
	public:
		ShaderManager(IGraphicsDevice* lpDevice, IMutex* lpGraphicsMutex);
		virtual ~ShaderManager();

		IShader*		LoadShader(const tstring& file, ShaderType::Enum type);
		IShader*		GetShader(const tstring& file, ShaderType::Enum type, Bool loadIfNotFound = true);

		IInputLayout*	LoadInputLayout(UInt32 inputLayout);
		IInputLayout*	GetInputLayout(UInt32 inputLayout, Bool loadIfNotFound = true);

	private:

		IGraphicsDevice*			m_lpGraphicsDevice;
		IMutex*						m_lpGraphicsMutex;

		map<tstring, IShader*>		m_Shaders;
		map<UInt32, IInputLayout*>	m_InputLayouts;

		ShaderManager(const ShaderManager& refShaderManager);
		ShaderManager& operator=(const ShaderManager& refShaderManager);
	};

}

#endif